<template>
  <el-table :data="tableData" size="mini">
    <el-table-column width="30" type="index" align="center" />
    <el-table-column width="80" prop="name1" label="设定温度" align="center">
    </el-table-column>
    <el-table-column prop="name2" label="开始时间" align="center">
    </el-table-column>
    <el-table-column prop="name3" label="结束时间" align="center">
    </el-table-column>
    <el-table-column prop="name4" label="实际温度范围" align="center">
      <template slot-scope="scope">
        <span v-if="scope.row.name10">
          {{ scope.row.name4 }}
        </span>
        <span v-else style="color: red;font-weight: bold;">
          {{ scope.row.name4 }}
        </span>
      </template>
    </el-table-column>
    <el-table-column prop="name5" label="工艺温度要求" align="center">
    </el-table-column>
    <el-table-column prop="name6" label="实际升温速度" align="center">
    </el-table-column>
    <el-table-column prop="name7" label="工艺升温速度要求" align="center">
    </el-table-column>
    <el-table-column prop="name8" label="实际保温时间" align="center">
    </el-table-column>
    <el-table-column prop="name9" label="工艺保温时间要求" align="center">
    </el-table-column>
    <el-table-column prop="name10" label="是否合格" align="center" width="80">
      <template slot-scope="scope">
        <el-tag v-if="scope.row.name10" type="success">合格</el-tag>
        <el-tag v-else type="warning">不合格</el-tag>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
import { timeDifference } from "@/utils/currentDate";
export default {
  data() {
    return {
      tableData: [
        {
          name1: "800℃",
          name2: "2022-12-11 11:00:00",
          name3: "2022-12-11 12:48:25",
          name4: "300℃ - 800℃",
          name5: "--",
          name6: "2.5℃/min",
          name7: "2℃/min ~ 4℃/min",
          name8: "--",
          name9: "--",
          name10: true
        },
        {
          name1: "800℃",
          name2: "2022-12-11 12:48:25",
          name3: "2022-12-11 14:10:25",
          name4: "800.9℃ - 811.2℃",
          name5: "790℃ ~ 810℃",
          name6: "--",
          name7: "--",
          name8: "82min",
          name9: "70min-90min",
          name10: false
        }
      ]
    };
  },
  computed: {
    faultDate() {
      return function(faultDate, completeTime) {
        return timeDifference(completeTime, faultDate);
      };
    }
  }
};
</script>

<style>
/* ::v-deep .el-table {
  margin-top: 10px;
  table {
    width: 100% !important;
  }
  .el-table__body,
  .el-table__header {
    width: 100% !important;
  }

  .el-table__body {
    width: 100% !important;
  }
} */
</style>
